﻿#region Imports
using System.IO;
using CommonUtilities.Extensions;
using CommonUtilities.Util;
using SeriesEpisodeMapper.ViewModels;
#endregion Imports

namespace SeriesEpisodeMapper.Models
{
    public class FInfo : BaseViewModel
    {
        private string filePath;
        public string FilePath
        {
            get { return filePath; }
            set
            {
                filePath = value;

                if (File.Exists(filePath))
                {
                    FileFolder = filePath.GetDirectoryNameFull();
                    FileName = Path.GetFileNameWithoutExtension(filePath);
                    FileExtn = Path.GetExtension(filePath).Trim('.');
                }
                else
                {
                    FileFolder = FileName = FileExtn = MainViewModel.sNA;
                }
            }
        }

        private string fileFolder;
        public string FileFolder
        {
            get { return fileFolder; }
            private set { fileFolder = value; RaisePropertyChanged("FileFolder"); }
        }

        private string fileName;
        public string FileName
        {
            get { return fileName; }
            private set { fileName = value; RaisePropertyChanged("FileName"); }
        }

        private string fileExtn;
        public string FileExtn
        {
            get { return fileExtn; }
            private set { fileExtn = value; RaisePropertyChanged("FileExtn"); }
        }
    }
}
